print("")


# 2.构造方法
class Person:
    name = None
    age = None

    def __init__(self, name, age):
        self.name = name
        self.age = age


p1 = Person('小明', 20)
print(p1.name)


class Person:
    def __init__(self, value):
        self.value = value


# 使用构造方法创建一个新的实例
my_object = Person(10)

# 打印对象的属性
print(my_object.value)  # 输出: 10
